using System;
using System.Text;
namespace ServiceStack.Logging
{
	public class StringBuilderLogFactory : ILogFactory
	{
		private StringBuilder sb;
		public StringBuilderLogFactory()
		{
			this.sb = new StringBuilder();
		}
		public ILog GetLogger(Type type)
		{
			return new StringBuilderLog(type, this.sb);
		}
		public ILog GetLogger(string typeName)
		{
			return new StringBuilderLog(typeName, this.sb);
		}
		public string GetLogs()
		{
			StringBuilder stringBuilder = this.sb;
			string result;
			lock (stringBuilder)
			{
				result = this.sb.ToString();
			}
			return result;
		}
		public void ClearLogs()
		{
			StringBuilder stringBuilder = this.sb;
			lock (stringBuilder)
			{
				this.sb.Remove(0, this.sb.get_Length() - 1);
			}
		}
	}
}
